import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
import 'vant/lib/index.css';
import './assets/common.scss';
import {
    Picker,
    Tabbar,
    Area,
    TabbarItem,
    NavBar,
    Row,
    Col,
    Swipe,
    SwipeItem,
    PullRefresh,
    Field,
    Cell,
    CellGroup,
    Button,
    Tab,
    Tabs,
    Divider,
    Grid,
    GridItem,
    Checkbox,
    CheckboxGroup,
    Icon,
    Dialog,
    Toast,
    DropdownMenu,
    DropdownItem,
    List,
    Popup,
    TreeSelect,
    Overlay,
    Collapse,
    Sticky,
    CollapseItem,
    Tag,
    RadioGroup,
    Radio,
    Image,
    Notify,
    NoticeBar,
    Search,
    Progress,
    ImagePreview,
    Empty,
    ShareSheet,
    ContactCard,
    Form,
    Calendar,
    Badge,
    Lazyload,
    Cascader,
    Uploader,
    Step,
    Steps,
    ActionSheet,
    SwipeCell,
    Highlight,
    Loading
} from "vant";
import directive from './directive' // directive
import { registerComponent } from './components/index'
const app = createApp(App)
// 在 main.js 或其他入口文件中
directive(app)
registerComponent(app)

app.use(Tabbar)
    .use(TabbarItem)
    .use(NavBar)
    .use(Row)
    .use(Col)
    .use(Swipe)
    .use(SwipeItem)
    .use(Field)
    .use(PullRefresh)
    .use(Cell)
    .use(CellGroup)
    .use(Button)
    .use(Tabs)
    .use(Tab)
    .use(Icon)
    .use(List)
    .use(DropdownMenu)
    .use(DropdownItem)
    .use(Popup)
    .use(Overlay)
    .use(Collapse)
    .use(CollapseItem)
    .use(TreeSelect)
    .use(Sticky)
    .use(Area)
    .use(Picker)
    .use(Divider)
    .use(Grid)
    .use(GridItem)
    .use(Checkbox)
    .use(CheckboxGroup)
    .use(Dialog)
    .use(Toast)
    .use(Tag)
    .use(RadioGroup)
    .use(Radio)
    .use(Image)
    .use(Notify)
    .use(NoticeBar)
    .use(Search)
    .use(Progress)
    .use(ImagePreview)
    .use(Empty)
    .use(ShareSheet)
    .use(ContactCard)
    .use(Calendar)
    .use(Badge)
    .use(Form)
    .use(Lazyload)
    .use(Cascader)
    .use(Uploader)
    .use(Step)
    .use(Steps)
    .use(ActionSheet)
    .use(Highlight)
    .use(Loading)
    .use(SwipeCell);

app.use(createPinia())
app.use(router)

app.mount('#app')
